package com.navinfo.collect;


import org.oscim.core.Point;

public class Test {

    public static void main(String[] args) {
        Test test = new Test();
        Point aPoint = new Point(3,3);
        Point bPoint = new Point(6,-3);

        Point a2Point = new Point(5,5);
        Point b2Point = new Point(6,-3);

        System.out.println(test.calc(aPoint,bPoint,a2Point,b2Point)+"");
    }

    public boolean calc(Point AleftTop, Point BrightBottom, Point A2leftTop, Point B2rightBottom) {

        double x1 = AleftTop.x;
        double y1 = AleftTop.y;

        double x2 = BrightBottom.x;
        double y2 = BrightBottom.y;

        double x11 = A2leftTop.x;
        double y11 = A2leftTop.y;

        double x22 = B2rightBottom.x;
        double y22 = B2rightBottom.y;

        if (x2<x11
                ||y2>y11
                ||x1>x22
                ||y1<y22) {
            return false;
        } else {
            return true;
        }
    }

}
